package cn.stylefeng.guns.modular.system.controller.CheckLogin;

import cn.stylefeng.guns.base.pojo.page.LayuiPageFactory;
import cn.stylefeng.guns.base.pojo.page.LayuiPageInfo;
import cn.stylefeng.guns.modular.system.entity.TApplicationAudit;
import cn.stylefeng.guns.modular.system.mapper.*;
import cn.stylefeng.roses.core.util.SpringContextHolder;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

/**
 * 查看审批记录
 *
 * @Author : xiaofei
 * @Date: 2019/7/27
 */
@Controller
@RequestMapping("/checkLogin")
public class CheckLoginController {


    private IndentOrderAuditMapper indentOrderAuditMapper = SpringContextHolder.getBean(IndentOrderAuditMapper.class);
    private SalesOrderAuditMapper salesOrderAuditMapper = SpringContextHolder.getBean(SalesOrderAuditMapper.class);
    private BothSaleCommitAuditMapper bothSaleCommitAuditMapper = SpringContextHolder.getBean(BothSaleCommitAuditMapper.class);
    private BothSaleAuditMapper bothSaleAuditMapper = SpringContextHolder.getBean(BothSaleAuditMapper.class);
    private TApplicationAuditMapper tApplicationAuditMapper = SpringContextHolder.getBean(TApplicationAuditMapper.class);
private DispatchOrderAuditMapper dispatchOrderAuditMapper = SpringContextHolder.getBean(DispatchOrderAuditMapper.class);

    /**
     * 查询订货单审核记录
     *
     * @param id
     * @return
     */
    @ResponseBody
    @RequestMapping("/indentOrderLogin/{id}")
    public LayuiPageInfo getCheckLoginList(@PathVariable Long id) {
        Page page = LayuiPageFactory.defaultPage();
        Page pageUse = indentOrderAuditMapper.getAuditLoginList(page, id);
        return LayuiPageFactory.createPageInfo(pageUse);
    }

    /**
     * 查询发货单审核记录
     *
     * @param id
     * @return
     */
    @ResponseBody
    @RequestMapping("/dispatcherOrderLogin/{id}")
    public LayuiPageInfo dispatcherOrderLogin(@PathVariable Long id) {
        Page page = LayuiPageFactory.defaultPage();
        Page pageUse = dispatchOrderAuditMapper.getAuditLoginList(page, id);
        return LayuiPageFactory.createPageInfo(pageUse);
    }

    /**
     * 查询销售单审核记录
     */
    @ResponseBody
    @RequestMapping("/salesOrderLogin/{id}")
    public LayuiPageInfo salesOrderLogin(@PathVariable Long id) {
        Page page = LayuiPageFactory.defaultPage();
        Page pageUse = salesOrderAuditMapper.getAuditLoginList(page, id);
        return LayuiPageFactory.createPageInfo(pageUse);
    }

    /**
     * 两地销售审核审核记录
     */
    @ResponseBody
    @RequestMapping("/bothSalesCommitLogin/{id}")
    public LayuiPageInfo bothSalesCommitLogin(@PathVariable Long id) {
        Page page = LayuiPageFactory.defaultPage();
        Page pageUse = bothSaleCommitAuditMapper.getAuditLoginList(page, id);
        return LayuiPageFactory.createPageInfo(pageUse);
    }

    /**
     * 两地销售审核记录
     */
    @ResponseBody
    @RequestMapping("/bothSalesLogin/{id}")
    public LayuiPageInfo bothSalesLogin(@PathVariable Long id) {
        Page page = LayuiPageFactory.defaultPage();
        Page pageUse = bothSaleAuditMapper.getAuditLoginList(page, id);
        return LayuiPageFactory.createPageInfo(pageUse);
    }

    /**
     * 退款申请审核记录
     */
    @ResponseBody
    @RequestMapping("/tApplicationLogin/{id}")
    public LayuiPageInfo tApplicationLogin(@PathVariable Long id) {
        Page page = LayuiPageFactory.defaultPage();
        Page pageUse = tApplicationAuditMapper.getAuditLoginList(page, id);
        return LayuiPageFactory.createPageInfo(pageUse);
    }
}
